﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;

namespace TA.Turbo.Controls
{
	public static	class _IHasControlState_Extensions
	{
		internal static StateBag GetStateBag(this IHasControlState This)
		{
			if (This is TPage)
			{
				return ((TPage)This).ControlState;
			}
			//else if (This is TControl)
			//{
				return ((TControl)This).ControlState;
			//}

			//throw new ArgumentException();
		}
	}
}
